package com.zhuannimei.parser;

import org.json.JSONException;
import org.json.JSONObject;

import com.zhuannimei.domain.OneShopProduct;

public class LotteryDetailParser extends BaseJSONParser<OneShopProduct> {

	@Override
	public OneShopProduct parseJSON(String jsonstr) throws JSONException {
		JSONObject jo = new JSONObject(jsonstr);
		JSONObject obj = jo.getJSONObject("result");
		OneShopProduct osp = new OneShopProduct();
		osp.setLuckId(obj.optString("luckId"));
		osp.setBuyed(obj.optString("buyed"));
		osp.setCtime(obj.optString("ctime"));
		osp.setDescribe(obj.optString("describe"));
		osp.setJoins(obj.optString("joins"));
		osp.setLast(obj.optString("last"));
		osp.setPhase(obj.optString("phase"));
		osp.setPicture(obj.optString("picture"));
		osp.setPrice(obj.optString("price"));
		osp.setTitle(obj.optString("title"));
		osp.setTotal(obj.optString("total"));
		osp.setCgyId(obj.optString("cgyId"));
		return osp;
	}

}
